package com.smsc.headend.connector.builder;

import com.smsc.headend.connector.bo.AssociationState;
import com.smsc.headend.connector.exception.UDISDeviceConException;
import com.smsc.headend.module.asset.entity.ComEntity;
import com.smsc.headend.module.asset.entity.Meter;

import io.netty.channel.Channel;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;

/**
 * @author liangli
 * @date 2020/8/30
 */
public interface AssociationBuilder {
     void buildAssociation(ComEntity terminal, Meter meter, Channel channel, AssociationState client) throws NoSuchPaddingException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, InvalidKeyException, UDISDeviceConException, InterruptedException, SignatureException;

     byte[] nextPacket(ComEntity com, AssociationState associationState) throws InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException, UDISDeviceConException, SignatureException;

     Boolean acceptPacket(ComEntity terminal, byte[] byteReceive, AssociationState associationState) throws UDISDeviceConException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException, SignatureException;
}
